package com.base.git;

import com.alibaba.druid.support.json.JSONUtils;

import java.util.List;

/**
 * @Author: xuyou
 * @Date: 2023/10/16 19:21
 * @Description:
 */
public class Main {

    public static void main(String[] args) throws Exception {
        String json = "{\n" +
                "      \"type\": \"cashAcknowledgmentInstruction\",\n" +
                "      \"params\": {\n" +
                "        \"contractNo\": \"$.basicInfo.contractNo\",\n" +
                "        \"tradeId\": \"#.dslResult.tradeId\",\n" +
                "        \"dealId\": \"#.dslResult.dealId\",\n" +
                "        \"settlementBatchNo\": \"#.dslResult.settlementBatchNo\",\n" +
                "        \"paymentBatchNo\": \"#.dslResult.paymentBatchNo\",\n" +
                "        \"eventNo\": \"#.dslResult.eventNo\",\n" +
                "        \"status\": \"#.dslResult.status\"\n" +
                "      }\n" +
                "}";


        String s = JSONUtils.parse(json).toString();
        System.out.println(s);

        GitCommandService service = new GitCommandService();

//        List<String> branchList = service.getBranchList();
//        System.out.println(branchList);
        //service.createJsonFile("refs/heads/master",json);
       // List<String> fileNameList = service.getFileNameList("refs/heads/master");
//        System.out.println(fileNameList);
       // String fileContent = service.getFileContent("refs/heads/master", "e110eb3b-044e-49a4-9230-561105792eff.json");

//        List<HistoryResponse> historyResponses =
//                service.getHistoryListByFileName("refs/heads/master", "contract-ide-be/src/main/java/com/demo/json/ac6af1b4-352b-41dd-87a5-81730e695844.json");
//        System.out.println(historyResponses);

         List<String> filePathListByCommitId = service.getFilePathListByCommitId("refs/heads/master", "dd3172ca5ad87d711caef8e5118acbfb484d2ab3");
        System.out.println(filePathListByCommitId);
//        UpdateFileContentRequest request = new UpdateFileContentRequest();
//        request.setBranch("refs/heads/master");
//        request.setFilePath("/contract-ide-be/src/main/java/com/demo/json/");
//        request.setFileName("ac6af1b4-352b-41dd-87a5-81730e695844.json");
//        request.setAuthorEmail("123@qq.com");
//        request.setAuthorName("179647302@qq.com");
//        request.setMessage("test123");
//        request.setJson("ce shi");
//        service.updateFileContent(request);
//
//        request.setJson("ce shi er cu");
//        service.updateFileContent(request);

    }





}
